package com.cv.audit.controller.audit.video;

import com.cv.audit.controller.audit.video.vo.AuditVideoLogSaveReqVO;
import com.cv.audit.controller.audit.video.vo.AuditVideoLogPageReqVO;
import com.cv.audit.controller.audit.video.vo.AuditVideoLogRespVO;
import com.cv.audit.service.video.AuditVideoLogService;
import com.cv.framework.common.pojo.PageResult;
import com.cv.framework.common.pojo.Result;
import com.cv.framework.role.core.annotations.RolePermit;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

import static com.cv.framework.common.pojo.Result.success;

/**
 * 视频审核日志控制层
 *
 * @author Charles_XDXD
 */
@Tag(name = "视频审核日志控制层")
@RestController
@RequestMapping("/audit/video/log")
public class AuditVideoLogController {

    @Resource
    private AuditVideoLogService auditVideoLogService;

    @PostMapping("save")
    @Operation(summary = "保存视频审核日志")
    @RolePermit(values = "audit_admin")
    public Result<Void> saveAuditVideoLog(@RequestBody AuditVideoLogSaveReqVO reqVO) {
        auditVideoLogService.saveAuditVideoLog(reqVO);
        return success();
    }

    @PostMapping("page")
    @Operation(summary = "分页查询视频审核日志")
    @RolePermit(values = "audit_admin")
    public Result<PageResult<AuditVideoLogRespVO>> getPage(@RequestBody AuditVideoLogPageReqVO reqVO) {
        return success(auditVideoLogService.getPage(reqVO));
    }

}
